<?php

require_once('./roots.php');
require_once('./classes/rbac.php');
require($root_path.'include/inc_environment_global.php');


$rbac=new rbac();
$gui=$rbac->Buscar_rol_usuario(NULL,$_POST['login_id'],$_SESSION['sess_login_username']);
//var_dump($gui);

$user=$_POST['login_id'];
foreach ($gui as $key => $value) {
	
//echo "valor:".$value["id_role"]." <br />\n";
$aux=$rbac->Revocar_rol_usuario($value["id_role"],$user,$_SESSION['sess_login_username']);
}

$result=$rbac->Destruir_usuario($_POST['login_id'], $_SESSION['sess_login_username']);

header("Location:$root_path/modules/rbac/UsuarioListEliminar.php?result=".$result."&lang=$lang");


?>
